package controller;

import bean.Dept;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import service.DeptService;

import java.util.List;

@Controller
public class DeptController {

    @Autowired
    DeptService service;

    @RequestMapping(value = "/getDeptNames", method = RequestMethod.GET)
    @ResponseBody
    public List<Dept> getDeptInfos() {
        return service.getDepts();
    }


}
